export function useOrderStatus() {
    const orderStateOptions = {
        1: '待审核',
        2: '已审核',
        3: '审核不通过',
        4: '饰品已转移',
        5: '抵押中',
        6: '已发起还款',
        7: '已完成',
        8: '已逾期',
        9: '已撤销'
    }

    const orderstate = (state: number) => {
        return orderStateOptions[state as keyof typeof orderStateOptions] || '未知状态'
    }

    const getStatusClass = (state: number) => {
        const statusClasses = {
            1: 'bg-blue-100 text-blue-600',
            2: 'bg-emerald-100 text-emerald-600',
            3: 'bg-red-100 text-red-600',
            4: 'bg-violet-100 text-violet-600',
            5: 'bg-amber-100 text-amber-600',
            6: 'bg-teal-100 text-teal-600',
            7: 'bg-green-100 text-green-600',
            8: 'bg-rose-100 text-rose-600',
            9: 'bg-slate-100 text-slate-600'
        }
        return statusClasses[state as keyof typeof statusClasses] || 'bg-gray-100 text-gray-600'
    }

    return {
        orderStateOptions,
        orderstate,
        getStatusClass
    }
}